#include <BaseConnection.h>

enum ETeamID;
enum EServerPacketType;
struct packet_base;

class IPacketSink
{
public:
    virtual bool ProcessPacket(EServerPacketType ePacketType, const packet_base* pPacket) = 0;
};

class CServerConnection : public CBaseConnection
{

public:
    CServerConnection();

    void UpdateWithPacketSink(IPacketSink* pPacketSink);

    void SendPacket(packet_base* pPacket);
    void SendLoginRequest(const char* szName, const char* szPass, const char* szLogin, bool isQuery);
    void SendTeamRequest(ETeamID eTeamID, int iShip);
    void SendPickSocket();
private:

    void ProcessReadBuffer(IPacketSink* pPacketSink);
    void Initialize();
    bool ProcessPacket(IPacketSink* pPacketSink, EServerPacketType ePacketType, packet_base* pPacket);
};

